//Promise 封装 getSetting 获取状态
export const getSetting = () =>{
    return new Promise((resolve,reject)=>{
        wx.getSetting({
            success:(resolve)=>{
                resolve(result)
            },
            fail:() =>{
                reject(err) 
            }
        })
    })
}
//Promise 封装 chooseAddress 获取地址
export const chooseAddress = () =>{
    return new Promise((resolve,reject)=>{
        wx.chooseAddress({
            success:(resolve)=>{
                resolve(result)
            },
            fail:() =>{
                reject(err) 
            }
        })
    })
}

//Promise 封装 openSetting  打开获取地址
export const openSetting = () =>{
    return new Promise((resolve,reject)=>{
        wx.openSetting({
            success:(resolve)=>{
                resolve(result)
            },
            fail:() =>{
                reject(err) 
            }
        })
    })
}

//弹框提示
export const showModal = ({content}) =>{
    return new Promise((resolve,reject)=>{
        wx.showModal({
            title: '提示',
            content: content,
            success: (res) => {
                resolve(res)
            },
            fail:(err)=>{
                reject(err)
            }
        })
    })
}